import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/Login'
import Home from '@/views/Home'
import PersonInfo from '@/views/userCenter/PersonInfo'
import MenuInfo from '@/views/system/MenuInfo'
import UserInfo from '@/views/system/UserInfo'
import RoleInfo from '@/views/system/RoleInfo'
import DeptInfo from '@/views/system/DeptInfo'
import PermissionInfo from '@/views/system/PermissionInfo'
import PatientInfo from '@/views/patient/PatientInfo'
import AppointmentInfo from '@/views/appointment/AppointmentInfo'
import ClinicPage from '@/views/setting/ClinicPage'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: '',
      component: Login,
      hidden: true,
      meta: {
        requireAuth: false
      }
    }, {
      path: '/login',
      name: '登录',
      component: Login,
      hidden: true,
      meta: {
        requireAuth: false
      }
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      iconCls: 'el-icon-tickets',
      children: [
        {
          path: '/personInfo',
          name: '个人信息',
          component: PersonInfo,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/menu',
          name: '菜单',
          component: MenuInfo,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/user',
          name: '用户',
          component: UserInfo,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/role',
          name: '角色',
          component: RoleInfo,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/dept',
          name: '部门',
          component: DeptInfo,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/permission',
          name: '权限',
          component: PermissionInfo,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/patient/patient',
          name: '患者',
          component: PatientInfo,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/appointment/appointment',
          name: '预约',
          component: AppointmentInfo,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/setting/clinic',
          name: '诊所',
          component: ClinicPage,
          meta: {
            requireAuth: true
          }
        }]
    }
  ]
})
